﻿using System;
using System.Net.Mime;
using Chambills.Present.Core;
using Chambills.Present.Core.NotifyOnChange;

namespace Present.Commands.Sample
{
    public class Logger : NotifiableObject
    {
        private readonly object padlock = new object();

        static Logger()
        {
            Instance = new Logger();
        }

        public static Logger Instance { get; private set; }

        public void Log(string message)
        {
            
           lock(padlock)
           {
               var msg = DateTime.Now.ToLongTimeString() + " - " + message;
               Text += msg + Environment.NewLine;
                OnPropertyChanged(() => Text);
            }
        }


        public string Text
        {
            get; set;
        }
    }
}